package cn.yunbamboos.rest.service.core;

public class ClassHelper {

    @SuppressWarnings("unchecked")
    public static  <U> Class<? extends U> asSubclass(Class<U> clazz, Class<?> in) {
        if (clazz.isAssignableFrom(in)) {
            return (Class<? extends U>) in;
        } else {
            throw new ClassCastException(in.toString());
        }
    }

}
